package com.lantosec.hmrp.modules.system.entity;

import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.system.vo.SysDictionariesVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

/**
 * <p>
 * 数据字典表 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-02-11
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SysDictionaries extends BaseEntity<SysDictionariesVO> {

    private static final long serialVersionUID = 1L;
    public SysDictionaries(SysDictionariesVO vo){
        this.dictionariesId = vo.getDictionariesId();
        this.dictionariesName = vo.getDictionariesName();
        this.dictionariesShowName = vo.getDictionariesShowName();
        this.dictionariesCode = vo.getDictionariesCode();
        this.parentId = vo.getParentId();
        this.leaf = vo.getLeaf();
        this.remark = vo.getRemark();
        this.allowDel = vo.getAllowDel();
        this.dictionariesOrder = vo.getDictionariesOrder();
        this.flag = vo.getFlag();
    }

    @Override
    public SysDictionariesVO convertToVO(){
        return new SysDictionariesVO(this);
    }


    /**
     * 字典ID
     */
    @TableId(value = "dictionaries_id", type = IdType.ASSIGN_UUID)
    private String dictionariesId;

    /**
     * 名称(唯一性)
     */
    private String dictionariesName;

    /**
     * 显示名称
     */
    private String dictionariesShowName;

    /**
     * 字典编码
     */
    private String dictionariesCode;

    /**
     * 上级ID
     */
    private String parentId;

    /**
     * 是否末级(0否,1是)
     */
    private Integer leaf;

    /**
     * 说明
     */
    private String remark;

    /**
     * 是否允许删除
     */
    private Integer allowDel;

    /**
     * 排序
     */
    private Integer dictionariesOrder;

    /**
     * 是否删除
     */
    private Boolean flag;


    public enum ColName {
        dictionaries_id, dictionaries_name, dictionaries_show_name, dictionaries_code, parent_id, leaf, remark, allow_del, dictionaries_order, flag, 
    }
}
